# -*- coding: utf-8 -*-
import os
from  pysql import mysqlOper
from downDocFile import downDocFile
from preDealDict import DealDownLoad
from reportPaper import Upload
from wordToPic import WrodToJpg


class autoScrapy:
    def __init__(self, workdir, accounts):
        self.accounts = accounts;
        self.workdir = workdir;
    def deal(self):
        # 下载doc文件
        df = downDocFile(self.workdir, self.account, 10);
        df.downdocfiles();
        # 预处理文件
        pd = DealDownLoad(self.workdir)
        pd.preZipFiles()
        # doc转化成pic
        wtp = WrodToJpg(self.workdir);
        # 上报
        rt = Upload(self.workdir);
        rt.report()
accounts = [];
accounts.append(('a1', 'p1'))
accounts.append(('a1', 'p1'))
workdir = '/work/temp/xuekewang'
auto = autoScrapy(workdir,accounts);
auto.deal();
